//
//  ChooseTableViewCell.m
//  Model
//
//  Created by wangchonggang on 16/9/18.
//  Copyright © 2016年 wcg. All rights reserved.
//

#import "ChooseTableViewCell.h"

#define ViewCount self.frame.size.width / 375

@implementation ChooseTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.HeadPic = [[UIImageView alloc] initWithFrame:CGRectZero];
        
        self.Title = [[UILabel alloc] initWithFrame:CGRectZero];
        
        self.SelectStatus = [[UIImageView alloc] initWithFrame:CGRectZero];
        
        [self.contentView addSubview:_HeadPic];
        [self.contentView addSubview:_Title];
        [self.contentView addSubview:_SelectStatus];
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    [_HeadPic setFrame:CGRectMake(24 / 2 * ViewCount, self.frame.size.height / 4, self.frame.size.height / 2, self.frame.size.height / 2)];
    [_HeadPic setImage:[UIImage imageNamed:@""]];
    
    [_Title setFrame:CGRectMake(_HeadPic.frame.origin.x + _HeadPic.frame.size.width, _HeadPic.frame.origin.y, self.frame.size.width - (_HeadPic.frame.origin.x + _HeadPic.frame.size.width) * 2, _HeadPic.frame.size.height)];
    [_Title setTextColor:[UIColor colorWithRed:102 / 255.0 green:102 / 255.0 blue:102 / 255.0 alpha:1]];
    [_Title setFont:[UIFont systemFontOfSize:28 / 2 * ViewCount]];
    
    [_SelectStatus setFrame:CGRectMake(self.frame.size.width - _HeadPic.frame.origin.x - _HeadPic.frame.size.width / 2, self.frame.size.height / 3, self.frame.size.height / 3, self.frame.size.height / 3)];
    [_SelectStatus setBackgroundColor:[UIColor lightGrayColor]];
    
    
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
